package com.fany.fastsearcher.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.fany.fastsearcher.R;
import com.fany.utils.BitmapHelper;
import com.fany.utils.ClipboardUtils;
import com.fany.utils.CommonUtils;

/**
 * Created by FANY on 2015/2/2.
 */
public class AboutActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about_activity);
        ImageView appIconImageView = (ImageView)findViewById(R.id.about_app_icon);
        Bitmap appIcon = BitmapHelper.loadBitmapResource(R.drawable.launcher);
        appIcon = BitmapHelper.toRoundCorner(appIcon, 48);
        appIconImageView.setImageBitmap(appIcon);

        ImageView authorImageView = (ImageView)findViewById(R.id.about_author);
        Bitmap authorIcon = BitmapHelper.loadBitmapResource(R.drawable.author);
        authorIcon = BitmapHelper.toRoundCorner(authorIcon, 48);
        authorImageView.setImageBitmap(authorIcon);

        ImageView mailImageView = (ImageView)findViewById(R.id.about_mail);
        Bitmap mailIcon = BitmapHelper.loadBitmapResource(R.drawable.mail);
        mailIcon = BitmapHelper.toRoundCorner(mailIcon, 48);
        mailImageView.setImageBitmap(mailIcon);

        TextView copyView = (TextView)findViewById(R.id.about_mail_copy);
        copyView.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                ClipboardUtils.clip(AboutActivity.this, getResources().getString(R.string.mail), "邮件地址已复制到剪贴板");
            }
        });
    }
}
